package com.css.zfzx.sjcj.modules.hddcB1TrenchBelongSamplePrj.service.impl;

import cn.afterturn.easypoi.excel.entity.result.ExcelVerifyHandlerResult;
import cn.afterturn.easypoi.handler.inter.IExcelVerifyHandler;
import com.css.bpm.platform.utils.PlatformObjectUtils;
import com.css.zfzx.sjcj.common.excel.util.ActiveFaultEasyExcelVerifyHelper;
import com.css.zfzx.sjcj.modules.hddcB1TrenchBelongSamplePrj.viewobjects.HddcB1TrenchbelongsampleprjVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class TrialTrenchSamplingEngineeringExcelVerifyHandler implements IExcelVerifyHandler<HddcB1TrenchbelongsampleprjVO> {

    private final ActiveFaultEasyExcelVerifyHelper helper;

    @Autowired
    public TrialTrenchSamplingEngineeringExcelVerifyHandler(ActiveFaultEasyExcelVerifyHelper helper) {
        this.helper = helper;
    }

    @Override
    public ExcelVerifyHandlerResult verifyHandler(HddcB1TrenchbelongsampleprjVO vo) {
        ExcelVerifyHandlerResult result = helper.verify(vo);
        if (PlatformObjectUtils.isEmpty(vo.getTrenchid()))
            helper.writeNotNullMsg(result, "探槽编号");
        if (PlatformObjectUtils.isEmpty(vo.getProjectid()))
            helper.writeNotNullMsg(result, "所属采样工程编号");
        return result;
    }
}
